package com.activititest.controller;


import com.activititest.appentity.Response;
import com.activititest.entity.EmEnterprise;
import com.activititest.service.IEmEnterpriseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import org.springframework.stereotype.Controller;

import java.util.HashMap;
import java.util.List;

///**
// * <p>
// *  前端控制器
// * </p>
// *
// * @author mfx
// * @since 2020-05-28
// */
@RestController
@RequestMapping("/enterprise/")
public class EmEnterpriseController {
    @Autowired
    private IEmEnterpriseService emEnterpriseService;

    @PostMapping("/findenterprises/")
    public Response<List<EmEnterprise>> findEnterprises(@RequestParam("areaid")  int areaid){
        HashMap map=new HashMap();
        map.put("enterprise_area_id",areaid);
        List<EmEnterprise> list = (List<EmEnterprise>) emEnterpriseService.listByMap(map);
        for(EmEnterprise aa:list){
            System.out.println(aa.getEnterpriseName());
        }
        Response euserResponse = new Response();
        euserResponse.setCode(200);
        euserResponse.setData(list);
        euserResponse.setMsg("yes");
        return euserResponse;

    }
}
//
